//
//  ProductModel.m
//  AffectionBee
//
//  Created by 程建良 on 16/8/20.
//  Copyright © 2016年 chivalrous. All rights reserved.
//

#import "ProductModel.h"

@implementation ProductModel

-(instancetype)initWithDict:(NSDictionary*)dict
{
    ProductModel* model = [[ProductModel alloc]init];
    
    
    [model setValuesForKeysWithDictionary:dict];
    
    
    
    return model;
}
+(instancetype)productModelWithDict:(NSDictionary*)dict
{
    return [[ProductModel alloc]initWithDict:dict];
}


//重写setValueForKey方法处理特殊的key
-(void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"id"])
    {
        self.productId = value;
    }
    else
    {
        [super setValue:value forKey:key];
    }
}


-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}
+(NSArray *)productList
{
    return nil;
}
@end
